package tako.wisers.com.android.apis.parser.xml.item;

import java.util.ArrayList;

public class Table {
	private String name;
	private String mapping;
	private ArrayList<Column> columnList;
	private ArrayList<String> columnNameList = new ArrayList<String>();
	private boolean inMemory;

	public Table() {
	}

	public Table(String name, String mapping, ArrayList<Column> columnList,
			boolean inMemory) {
		this.name = name;
		this.mapping = mapping;
		this.columnList = columnList;
		this.inMemory = inMemory;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMapping() {
		return mapping;
	}

	public void setMapping(String mapping) {
		this.mapping = mapping;
	}

	public ArrayList<Column> getColumnList() {
		return columnList;
	}

	public void setColumnList(ArrayList<Column> columnList) {
		this.columnList = columnList;
	}

	public void addColumn(Column column) {
		if(!columnNameList.contains(column.getName())){
			columnNameList.add(column.getName());
			columnList.add(column);
		}
	}

	public ArrayList<String> getColumnNameList() {
		return columnNameList;
	}

	public boolean isInMemory() {
		return inMemory;
	}

	public void setInMemory(boolean inMemory) {
		this.inMemory = inMemory;
	}

}
